#ifndef LOG_H
#define LOG_H

#include <string>

#include "Types.h"
#include "LogOutput.h"
#include "Entry.h"
#include "Logger.h"

#include "../concurrent/ReaderWriter.h"

namespace logging {

class Log
{
public:
	Log(LogOutput *output, char* ns, Level level=log_warn);
	~Log();

	Logger debug();
	Logger info();
	Logger warn();
	Logger error();
	Logger fatal();

	char* getNamespace() const { return _namespace; }
	Level getLevel();
	void setLevel(Level level);

private:
	LogOutput *_output;
	char* _namespace;
	concurrent::ReaderWriter _lock;
	Level _level;
};

}

#endif /* LOG_H */
